import Vue from 'vue'
import Vuex from 'vuex'
import axios from "axios"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    echongs:null,
  },
  mutations: {
    addEchong(state,value){
      state.echongs = value
    }
  },
  actions: {
      async requeApi(context,state){
      let datas = await axios({
        url:"https://mall.api.epet.com/v3/index/home.html?pet_type=dog&version=554&is_single=0&isWeb=1&system=wap&distinct_id=17c2b39bc8d274-022dcac363853b8-17466957-230400-17c2b39bc8e91c&debug_param="
      })
      context.commit("addEchong",datas)
      // console.log(datas,"-----");
    }
   
  },
  modules: {
   
  }
})
